﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Hallenberg.SmartClient.Interfaces
{
    /// <summary>
    /// The IEventHandler is the base interface used by the EventManager.
    /// Instead of implementing this interface, use BaseEventHandler class.
    /// Classes exposing this interface and not the BaseEventHandler class will not be detected and
    /// registered by the framework type handlers.
    /// </summary>
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "The naming of this interface is the most precise naming available")]
    public interface IEventHandler
    {
        /// <summary>
        /// Handles the event being subscribed to.
        /// </summary>
        /// <param name="sender">The class raising the event.</param>
        /// <param name="args">The event arguments. Will always be of type EventArgs(T)</param>
        void HandleEvent(object sender, EventArgs args);

        /// <summary>
        /// Run the event asynchronous on the thread pool?
        /// </summary>
        bool Async { get; }
    }
}
